mount: remove directory if mounting fails
authorRafał Miłecki <[email protected]>
Wed, 3 Jan 2018 10:31:22 +0000 (11:31 +0100)
committerJohn Crispin <[email protected]>
Sun, 7 Jan 2018 11:49:17 +0000 (12:49 +0100)
commite31565a287c6b44763d5b11bdc88c2d79c5e508e
tree92277cf603013df1f33cad8dcf91c60a58dce1f5
parent0f4f20ba5ce2dc24914c231eb2984d40b30d2adb
mount: remove directory if mounting fails

Aside from just cleaning up mountd's tmp dir it's also important for
autofs support. With such an empty directory autofs_process_request
believed device is mounted and it kept replying AUTOFS_IOC_READY to the
kernel. It was causing a log storm like:
mountd[1015]: Got a autofs packet
mountd[1015]: kernel is requesting a mount -> sda1
mountd[1015]: Got a autofs packet
mountd[1015]: kernel is requesting a mount -> sda1
mountd[1015]: Got a autofs packet
mountd[1015]: kernel is requesting a mount -> sda1

Signed-off-by: Rafał Miłecki <[email protected]>
mount.c